<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page isELIgnored="false" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">

    <link rel="stylesheet" type="text/css" href="/admin/static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="/admin/lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/style.css"/>

</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 软件审核管理 <span
        class="c-gray en">&gt;</span>下线申请<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
                                            href="javascript:location.replace(location.href);" title="刷新"
                                            id="refresh"><i
        class="Hui-iconfont">&#xe68f;</i></a></nav>

<div class="page-container">
    <div class="mt-20">
        <table class="table table-border table-bordered table-hover table-bg table-sort">
            <thead>
            <tr class="text-c">
                <th width="80">ID</th>
                <th width="100">软件ID</th>
                <th width="100">软件名称</th>
                <th width="100">申请人</th>
                <th width="150">申请时间</th>
                <th width="100">软件类型</th>
                <th width="100">操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach var="data" items="${dataMap}">
                <tr class="text-c">
                    <td><a href="#">${data[0]}</a></td>
                    <td><a href="#">${data[1]}</a></td>
                    <td>${data[2]}</td>
                    <td>${data[3]}</td>
                    <td><fmt:formatDate value="${data[4]}" pattern="yyyy-MM-dd HH:mm"/></td>

                    <td><c:if test="${data[5]==0}">软件</c:if>
                        <c:if test="${data[5]==1}">游戏</c:if></td>
                    <td><a title="通过" href="javascript:;" class="ml-5"
                           style="text-decoration:none" onclick="passApply(this,'${data[1]}',-2)"><i
                            class="Hui-iconfont">&#xe6e1;</i></a><a title="拒绝" href="javascript:;" class="ml-5"
                                                                    style="text-decoration:none"
                                                                    onclick="passApply(this,'${data[1]}',-3)"><i
                            class="Hui-iconfont">&#xe6dd;</i></a></td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>
<!--[if lt IE 9]>
<script type="text/javascript" src="/admin/lib/html5shiv.js"></script>
<script type="text/javascript" src="/admin/lib/respond.min.js"></script>
<![endif]-->
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/admin/lib/laypage/1.2/laypage.js"></script>
<script>
    $(function () {
        $('.table-sort').dataTable({});
    });

    function passApply(obj, id, state) {
        var value = "";
        if (state == "-2")
            value = "通过";
        else
            value = "拒绝";
        layer.confirm("你确定要" + value + "该软件的下线申请么?", function (index) {
            var url = "/SoftwareAdmin/admin/applyDownOffice"
            $.post(url, {id: id, state: state}, function (data) {
                if (data.valueOf() == "true") {
                    $(obj).parents('tr').remove();
                    layer.msg(value + "成功", {icon: 1, time: 2000});
                } else {
                    layer.msg(value + "失败,请稍后重试", {icon: 3, time: 2000});
                }
            });
        });
    }
</script>
</body>
</html>